@include("system::admin.layouts._header")
<body>
<style>
    .stub-type {
        display: none
    }
</style>
<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form" method="post">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                <li class="layui-this">基本信息</li>
                <li>防屏蔽设置</li>
            </ul>

            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item">
                        <label class="layui-form-label required">名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" class="layui-input" lay-verify="required" lay-reqtext="请输入名称"
                                   placeholder="请输入名称" value="">
                            <tip>填写名称。</tip>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label required">标识</label>
                        <div class="layui-input-block">
                            <input type="text" name="code" class="layui-input" lay-verify="required" lay-reqtext="请输入标识"
                                   placeholder="请输入标识" value="">
                            <tip>填写标识（字母）。</tip>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">描述</label>
                        <div class="layui-input-block">
                            <textarea name="description" class="layui-textarea" placeholder="请输入描述"></textarea>
                            <tip>填写描述。</tip>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label required">类型</label>
                        <div class="layui-input-block">
                            <select name="type" id="type" lay-filter="type">
                                <option value="">选择素材类型</option>
                                @foreach(config('ads.types') as $key => $item)
                                    <option value="{{$key}}">{{$item}}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>

                    @foreach(config('ads.types') as $key => $item)
                    <div id="tpl-{{$key}}" class="stub-type">
                        @include("ads::admin.stubs.{$key}")
                    </div>
                    @endforeach

                </div>
                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <label class="layui-form-label">备用图片</label>
                        <div class="layui-input-block layuimini-upload">
                            <input name="forbid_img" class="layui-input layui-col-xs6" placeholder="请上传备用图片"
                                   value="">
                            <div class="layuimini-upload-btn">
                            <span><a class="layui-btn" data-upload="forbid_img" data-upload-number="one"
                                     data-upload-exts="ico|png|jpg|jpeg"><i class="fa fa-upload"></i> 上传</a></span>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">备用链接</label>
                        <div class="layui-input-block">
                            <input type="text" name="forbid_url" class="layui-input" placeholder="请输入备用链接" value="">
                        </div>
                    </div>
                </div>
            </div>

            <div class="hr-line"></div>
            <div class="layui-form-item text-center">
                <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
                <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
            </div>
        </div>

    </form>
</div>


<div id="link-res" style="display: none">

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">超链接</label>
            <div class="layui-input-inline">
                <input type="text" name="link[text][]" placeholder="文本" autocomplete="off"
                       class="layui-input">
            </div>
        </div>

        <div class="layui-inline">
            <div class="layui-input-inline">
                <input type="text" name="link[url][]" placeholder="链接" autocomplete="off" class="layui-input">
            </div>
        </div>

    </div>

</div>

<div id="image-res" style="display: none">
    <fieldset style="margin-bottom: 10px">
        <legend>图片广告</legend>
        <div class="layui-form-item">
            <label class="layui-form-label">图片</label>
            <div class="layui-input-block layuimini-upload">
                <input name="image[path][{num}]" class="layui-input layui-col-xs6" placeholder="请上传图片"
                       value="">
                <div class="layuimini-upload-btn">
                            <span><a class="layui-btn" data-upload="image[path][{num}]" data-upload-number="one"
                                     data-upload-exts="ico|png|jpg|jpeg"><i class="fa fa-upload"></i> 上传</a></span>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">链接</label>
            <div class="layui-input-block">
                <input type="text" name="image[url][{num}]" class="layui-input" placeholder="请输入链接" value="">
            </div>
        </div>
    </fieldset>

</div>

</body>
</html>
